#include "Matrix.h"
#define MATRIX_DEBUG 1
#if MATRIX_DEBUG == 1
#include <ctime>
#endif
#include <iostream>
using namespace std;

class MatrixInConsole : public Matrix
{
	MatrixInConsole() : Matrix(){}

	void SetRand(T min, T max);				// 设置随机矩阵，测试使用

	// 其他
	void ConsolePrint();					// 控制台下打印矩阵
}

#if MATRIX_DEBUG == 1
template<class T>
void MatrixInConsole::SetRand(T min, T max)
{
	srand((unsigned)time(0));

	int mod = static_cast<int>(max - min)
		for(int i = 0; i < MATRIX_NUM; i++)
		{
			for(int j = 0; j < MATRIX_NUM; j++)
			{
				_data[i][j] = static_cast<T>(rand() % mod) + min;
			}
		}
}
#endif

template<class T>
void MatrixInConsole::ConsolePrint()					// 控制台下打印矩阵
{
	cout << "The Matrix is :" << endl << setw(10);
	for(int i = 0; i < MATRIX_NUM; i++)
	{
		for(int j = 0; j < MATRIX_NUM; j++)
		{
			cout << _data[i][j];
		}
		cout << endl;
	}
}
